<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cr&eacute;ation d'un sondage - <fmt:message
	key="appTitle" /></title>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/styles/base.css" />' />
<link rel="stylesheet" type="text/css"
	href='<c:url value="/styles/charte.css" />' />

</head>
<body>
<jsp:include page="/js/formQuestion.js" />

<div id="global"><jsp:include page="header.jsp" /> <jsp:include
	page="menu.jsp" />

<div id="contenu"><c:choose>
	<c:when test="${modification==true}">
		<h2>Modification d'une question</h2>
	</c:when>
	<c:otherwise>
		<h2>Cr&eacute;ation d'une question</h2>
	</c:otherwise>
</c:choose> <form:form method="post" commandName="newQuestionForm">
	<table>
		<tr>
			<td>Titre :</td>
			<td><form:input path="title" /></td>
			<td><form:errors path="title" cssClass="errorMsg" /></td>
		</tr>
		<tr>
			<td>Type :</td>
			<td><form:select path="type" id="type"
				onchange="javascript:addButton();">
				<c:forEach var="type"
					items="<%=faf.entities.QuestionType.values()%>">
					<form:option value="${type}">
						<c:choose>
							<c:when test="${type=='STRING'}">
								Phrase
							</c:when>
							<c:when test="${type=='TEXT'}">
								Paragraphe
							</c:when>
							<c:when test="${type=='FILE'}">
								Pi&egrave;ce jointe
							</c:when>
							<c:otherwise>
								Choix Multiple
							</c:otherwise>
						</c:choose>
					</form:option>
				</c:forEach>
			</form:select></td>
			<td><form:errors path="type" cssClass="errorMsg" /></td>
		</tr>
		<tbody id="bt">
			<tr>
				<td></td>
				<td><c:if test="${size>0}">
					<input id="add" type="button" value="Ajouter une propriété"
						onclick="javascript:addProperty();" />
				</c:if></td>
			</tr>
		</tbody>
		<tbody id="propriete">
			<c:if test="${size>0}">
				<c:forEach var="propertie" items="${properties}">
					<tr id="a<c:out value="${propertie.id}" />">
						<td>Propriété :</td>
						<td><input name="_<c:out value="${propertie.value}" />"
							value="<c:out value="${propertie.value}" />" /></td>
						<td><img src='<c:url value="/images/icons/cross.png" />'
							alt="supprimer"
							onclick="javascript:remove('a<c:out value="${propertie.id}" />');" /></td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
		<tr>
			<td>Statut :</td>
			<td><form:select path="obligatory">
				<form:option value="true">Obligatoire</form:option>
				<form:option value="false">Facultatif</form:option>
			</form:select></td>
			<td><form:errors path="obligatory" cssClass="errorMsg" /></td>
		</tr>
		<tr>
			<td></td>
			<td><input type="submit" value="Valider"></td>
			<td></td>
		</tr>
	</table>
	<br>
	<input name="surveyFromNewquestion" type="hidden"
		value="${surveyFromEdit}" />
</form:form></div>



<jsp:include page="footer.jsp" /></div>
</body>
</html>